import { Controller } from "../../mvc/core/Controller";
import { DataEvent } from "../events/DataEvent";
import { EActiveType } from "../../../Message/Public/EActiveType";
import { LevelSealInfo } from "../view/mainUI/info/LevelSealInfo";
import { GameMapUtil } from "../scene/map/GameMapUtil";
import { IView } from "../../mvc/interfaces/IView";
import { GameUI } from "../view/mainUI/GameUI";
import { LayerManager } from "../manager/LayerManager";
import { GameController } from "../mvc/GameController";
import { ClockManager } from "../manager/ClockManager";
import { Dispatcher } from "../../mvc/core/Dispatcher";
import { EventName } from "../mvc/EventName";
import { NetDispatcher } from "../../mvc/core/NetDispatcher";
import { ServerCommand } from "../mvc/ServerCommand";
import { RolePlayer } from "../scene/player/entity/RolePlayer";
import { PlayerEvent } from "../scene/events/PlayerEvent";
import { DrugChangeConfig } from "../resource/DrugChangeConfig";
import { BuffRule } from "../rules/BuffRule";
import { BuffInfo } from "../view/avatar/BuffInfo";
import { ParamsConst } from "../../common/global/ParamsConst";
import { BrowerUtil } from "../../../com/gengine/utils/BrowerUtil";
import { Game } from "../Game";
import { Language } from "../../../extend/language/Language";
import { MsgManager } from "../manager/MsgManager";
import { Cache } from "../cache/Cache";
import { GameConst } from "../../component/gconst/GameConst";
import { EEntityFightMode } from "../../../Message/Public/EEntityFightMode";
import { SRole } from "../../../Message/Game/SRole";
import { GameProxy } from "../mvc/GameProxy";
import { EDrug } from "../../../Message/Public/EDrug";
import { AutoFight } from "../view/autoFight/AutoFight";
import { RoleDrugEnoughType } from "../view/avatar/RoleDrugEnoughType";
import { UiHintIconView } from "../view/uiIconBtn/UiHintIconView";
import { PulseSharedObject } from "../view/player/PulseSharedObject";
import { DrugHintIcon } from "../view/mainUI/DrugHintIcon";
import { IEntity } from "../scene/player/IEntity";
import { EntityType } from "../rules/EntityType";
import { AStarPoint } from "../scene/map/AStarPoint";
import { GameManager } from "../manager/GameManager";
import { SoundManager } from "../../common/sound/SoundManager";
import { SoundTypeConst } from "../../common/sound/SoundTypeConst";
import { SEntityInfo } from "../../../Message/BroadCast/SEntityInfo";
import { ThingUtil } from "../scene/layer/utils/ThingUtil";
import { GModuleEvent } from "../mvc/GModuleEvent";
import { FeedType } from "../view/pet/FeedType";
import { PetDrugEffect } from "../view/pet/PetDrugEffect";
import { ECopyType } from "../../../Message/Public/ECopyType";
import { EMapInstanceType } from "../../../Message/Public/EMapInstanceType";
import { SPublicMiniPlayer } from "../../../Message/Public/SPublicMiniPlayer";
import { EntityUtil } from "../scene/layer/utils/EntityUtil";
import { ModuleType } from "../view/common/ModuleType";
import { ItemData } from "../resource/info/ItemData";
import { SVIPInfo } from "../../../Message/Game/SVIPInfo";
import { DrugBagWindow } from "../view/mainUI/DrugBagWindow";
import { SDrugBagInfo } from "../../../Message/Game/SDrugBagInfo";
import { WalkthroughListWindow } from "../view/walkthrough/WalkthroughListWindow";
import { Life } from "../../../FeedType/Life";
import { Duration } from "../../../PetDrugEffect/Duration";
import { Energy } from "../../../FeedType/Energy";
import { Moment } from "../../../PetDrugEffect/Moment";
type int = number;
//class GameUIController
    
    export  class GameUIController extends Controller
    {
        constructor()
        {
            
            super();this.init();
            return;
        }

        /* internal  */onShortcutKeyLabelUpdateHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            if (this._gameui) 
            {
                this._gameui.updateAllShortcutKey(loc1);
            }
            return;
        }

        /* internal  */onAcitveTimeUpdateHandler(arg1: DataEvent): void
        {
            var loc1=cache.active.isActiveInEffect(EActiveType._EActiveTypeCloseLottery);
            cache.role.isColseLotteryActive = loc1;
            return;
        }

        /* internal  */onFirstReachLevelSealCommandHandler(arg1: LevelSealInfo): void
        {
            if (this._gameui) 
            {
                this._gameui.updateByLevelSealInfo(arg1);
            }
            return;
        }

        /* internal  */onShowPetAvatarHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (this._gameui) 
            {
                this._gameui.removeAvatar(2);
            }
            return;
        }

        /* internal  */onCrossMainCityBelongInfoChangeHandler(arg1): void
        {
            if (GameMapUtil.curMapState.isCrossMainCity) 
            {
                this._gameui.updateMapName(cache.scene.getCampMapName());
            }
            return;
        }

        
        {
            GameUIController._isShowResumeTip = true;
        }

        /* internal  */init(): void
        {
            return;
        }

        protected /* override */ initView(): IView
        {
            if (this._gameui == null) 
            {
                this._gameui = new GameUI();
                this._gameui.addEventListener(flash.events.MouseEvent.CLICK, this.onGameUIClickHandler);
                LayerManager.uiLayer.addChild(this._gameui);
                GameController.chat.view.show();
                GameController.taskTrack.view.show();
                this._gameui.addShortcuts(GameController.shortcuts.view as Object /* flash.display.DisplayObject */);
            }
            if (ClockManager.instance.serverOpenDateNum <= 3) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GetPanicBuyConfig));
            }
            if (cache.role.entityInfo.level >= 65) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnShowIcon));
            }
            return this._gameui;
        }

        protected /* override */ initServer(): void
        {
            NetDispatcher.addCmdListener(ServerCommand.RoleExpUpdate, this.onRoleExpHandler);
            NetDispatcher.addCmdListener(ServerCommand.SkillShortCatUpdate, this.onSkillShortCatUpdate);
            NetDispatcher.addCmdListener(ServerCommand.BufferUpdate, this.onBufferUpdate);
            NetDispatcher.addCmdListener(ServerCommand.DailyAward, this.onDailyAwardAdd);
            NetDispatcher.addCmdListener(ServerCommand.LevelAward, this.onLevelAwardAdd);
            NetDispatcher.addCmdListener(ServerCommand.Group_PlayerInfoChange, this.onGroupPlayerInfoChange);
            NetDispatcher.addCmdListener(ServerCommand.CrossGroup_PlayerInfoChange, this.onGroupPlayerInfoChange);
            Dispatcher.addEventListener(EventName.GotoPay, this.onGotoPayHandler);
            Dispatcher.addEventListener(EventName.CopyEnterCopyMap, this.onEnterCopyMap);
            Dispatcher.addEventListener(EventName.CopyLeaveCopyMap, this.onLeaveCopyMap);
            Dispatcher.addEventListener(EventName.NewMailCome, this.onNewMailComeHandler);
            Dispatcher.addEventListener(EventName.NewMailHadQuery, this.onNewMailHadQuery);
            Dispatcher.addEventListener(EventName.TWHui_NotHaveVisitAll, this.onTWhuiNotHaveVisitAll);
            Dispatcher.addEventListener(EventName.MapUpdateRolePosition, this.onMapUpdateRolePosition);
            Dispatcher.addEventListener(EventName.MapFindPath, this.onMapFindPath);
            Dispatcher.addEventListener(EventName.Player_Selected, this.onPlayerSelected);
            Dispatcher.addEventListener(EventName.Scene_Update, this.onSceneUpdateHandler);
            Dispatcher.addEventListener(EventName.Convey_Res, this.onConveyRes);
            Dispatcher.addEventListener(EventName.PetRestSuccess, this.onPetRestSuccessHandler);
            Dispatcher.addEventListener(EventName.PetDeath, this.onPetDeathHandler);
            Dispatcher.addEventListener(EventName.Scene_Pet_Update, this.onScenePetUpdateHandler);
            Dispatcher.addEventListener(EventName.PetBagUpdate, this.onPetBagUpdateHandler);
            Dispatcher.addEventListener(EventName.FightSetMode, this.onFightSetModeHandler);
            Dispatcher.addEventListener(EventName.FightSetModeSuccess, this.onFightSetModeSuccessHandler);
            Dispatcher.addEventListener(EventName.RoleAutoResume, this.onRoleAutoResumeHandler);
            Dispatcher.addEventListener(EventName.PetAutoResume, this.onPetAutoResumeHandler);
            Dispatcher.addEventListener(EventName.GuideDrugBuyClose, this.onGuideDrugBuyCloseHandler);
            cache.timeCdCache.changeShengLifeCd.addCompleteFunction(this.cdComplete);
            cache.timeCdCache.manaCD.addCompleteFunction(this.cdComplete);
            Dispatcher.addEventListener(EventName.Guide_ModuleOpen, this.onGuideModuleOpen);
            Dispatcher.addEventListener(EventName.Guide_ModuleHide, this.onGuideModuleHide);
            Dispatcher.addEventListener(EventName.GuideDailyModule, this.onGuideDaily);
            Dispatcher.addEventListener(EventName.Guide_PetFightGuide, this.onGuidePetFight);
            Dispatcher.addEventListener(EventName.Guide_PetEquipRefresh, this.onGuidePetEquipRefresh);
            Dispatcher.addEventListener(EventName.Guide_PetEquipStrenthen, this.onGuidePetEquipStrenthenHandler);
            Dispatcher.addEventListener(EventName.Guide_FirstPurplePetEquipment, this.onGuideFirstPurplePetEquipmentHandler);
            Dispatcher.addEventListener(EventName.Guide_SkillMarryLeared, this.onGuideSkillMarry);
            Dispatcher.addEventListener(EventName.Guide_PetLifeStyleGetOpen, this.onGuidePetLifeStyleOpen);
            Dispatcher.addEventListener(EventName.GameUINavBarSetButtonVisible, this.onGameUINavBarSetButtonVisibleHandler);
            Dispatcher.addEventListener(EventName.AutoFightKeyToFight, this.onAutoFightKey);
            RolePlayer.instance.addEventListener(PlayerEvent.UPDATEINFO, this.onPlayerRoleInfoUpdate);
            Dispatcher.addEventListener(EventName.ChangePosition, this.onMapUpdateRolePosition);
            RolePlayer.instance.addEventListener(PlayerEvent.WALK_END, this.onRoleMoveEnd);
            Dispatcher.addEventListener(EventName.UseDrugBagSuccess, this.onUseDrugBagSuccessHandler);
            Dispatcher.addEventListener(EventName.SkillWindowShow, this.onSkillWindowShowHandler);
            Dispatcher.addEventListener(EventName.Equipment_WindowOpen, this.onEquipmentWindowOpen);
            Dispatcher.addEventListener(EventName.GuildWindowShow, this.onGuildWindowOpenHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.RoleTurned, this.onRoleTurnedHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.MarrySkillTurnChange, this.onMarrySkillTurnChangeHandler);
            Dispatcher.addEventListener(EventName.BuffRemainTimeUpdate, this.onBuffRemainTimeUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.MakeFunTargetStatus, this.onMakeFunHandler);
            Dispatcher.addEventListener(EventName.HighlightGameUI, this.onHighlightGameUIHandler);
            Dispatcher.addEventListener(EventName.FavoriteUpdate, this.onFavoriteUpdateHandler);
            Dispatcher.addEventListener(EventName.AddFavorite, this.onAddFavoriteHandler);
            Dispatcher.addEventListener(EventName.Guide_ShowVipCard, this.onShowVipCard);
            Dispatcher.addEventListener(EventName.Guide_HideVipCard, this.onHideVipCard);
            Dispatcher.addEventListener(EventName.TestVIPCardRes, this.onTestVIPCardRes);
            Dispatcher.addEventListener(EventName.QuestionShowMainBtn, this.onQuestionShowMainBtnHandler);
            Dispatcher.addEventListener(EventName.QuestionRemoveMainBtn, this.onQuestionRemoveMainBtnHandler);
            Dispatcher.addEventListener(EventName.FlyLevelAward, this.onFlyLevelAwardHandler);
            NetDispatcher.addCmdListener(ServerCommand.VIPLevelUpgrade, this.onVIPLevelUpgradeHandler);
            Dispatcher.addEventListener(EventName.Guide_CanonBookShow, this.onShowWalkthroughHandler);
            Dispatcher.addEventListener(EventName.WalkthroughWindowOpen, this.onWalkthroughWindowOpenHandler);
            Dispatcher.addEventListener(EventName.RoleEnergyComplete, this.onRoleEnergyCompleteHandler);
            Dispatcher.addEventListener(EventName.DailyDegreeUpdate, this.onDailyDegreeUpdate);
            Dispatcher.addEventListener(EventName.SkillLevelGetShow, this.onSkillLevelGetShowHandler);
            Dispatcher.addEventListener(EventName.Guide_PetSkillRefreshOpenModule, this.onGuidePetSkillRefreshHandler);
            Dispatcher.addEventListener(EventName.DrugBagWindowOpen, this.onDrugBagWindowOpenHandler);
            NetDispatcher.addCmdListener(ServerCommand.DrugBagInfoUpdate, this.onDrugBagInfoUpdateHandler);
            NetDispatcher.addCmdListener(ServerCommand.PetDrugBagInfoUpdate, this.onDrugBagInfoUpdateHandler);
            Dispatcher.addEventListener(EventName.Guide_FragmentUseOpenPack, this.onGuideFragmentOpenPackHandler);
            Dispatcher.addEventListener(EventName.Guide_FragmentUseOpenRole, this.onGuideFragmentOpenRoleHandler);
            Dispatcher.addEventListener(EventName.Role_FlyStart, this.onRoleFlyStartHandler);
            Dispatcher.addEventListener(EventName.Role_FlyEnd, this.onRoleFlyEndHandler);
            RolePlayer.instance.addEventListener(PlayerEvent.RoleLevelUpdate, this.onRoleLevelUpdate);
            Dispatcher.addEventListener(EventName.ShortcutKeyLabelUpdate, this.onShortcutKeyLabelUpdateHandler);
            Dispatcher.addEventListener(EventName.AcitveTimeUpdate, this.onAcitveTimeUpdateHandler);
            Dispatcher.addEventListener(EventName.HavePay, this.onHavePayHandler);
            Dispatcher.addEventListener(EventName.ShowGameMainUI, this.onShowGameMainUI);
            Dispatcher.addEventListener(EventName.ShowOrHideShortcut, this.onShowOrHideShortcut);
            Dispatcher.addEventListener(EventName.ShowPetAvatar, this.onShowPetAvatarHandler);
            NetDispatcher.addCmdListener(ServerCommand.CrossMainCity_BelongInfoChange, this.onCrossMainCityBelongInfoChangeHandler);
            return;
        }

        protected onRoleLevelUpdateHandler(arg1: Object /* flash.events.Event */): void
        {
            if (cache.role.entityInfo.level > 36 && this._gameui) 
            {
                this._gameui.showShrinkBtn();
            }
            if (cache.role.entityInfo.level >= 65) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnShowIcon));
            }
            return;
        }

        /* internal  */onShowGameMainUI(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (this._gameui && cache.role.entityInfo.level > 36) 
            {
                this._gameui.showAllUI(loc1);
            }
            return;
        }

        /* internal  */onShowOrHideShortcut(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (this._gameui) 
            {
                this._gameui.showOrHideShortcut(loc1);
            }
            return;
        }

        /* internal  */onHavePayHandler(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.showVipHelpBtn();
            }
            return;
        }

        /* internal  */onMakeFunHandler(arg1: Boolean): void
        {
            RolePlayer.instance.isMakeFunTargetStatus = arg1;
            if (arg1) 
            {
                if (this._gameui) 
                {
                    this._gameui.removeTurnedHintIcon();
                }
            }
            return;
        }

        /* internal  */onRoleTurnedHandler(arg1: PlayerEvent): void
        {
            var loc1=false;
            var loc2=null;
            var loc3=null;
            if (RolePlayer.instance.needShowTurnedBtn) 
            {
                if (this._gameui) 
                {
                    this._gameui.addTurnedHintIcon();
                    if ((loc3 = cache.buff.showBuffArray) && loc3.length > 0) 
                    {
                        var loc4=0;
                        var loc5=loc3;
                        for(loc2 of loc5) 
                        {
                            if (!(loc2.tstate.category == 1 && DrugChangeConfig.instance.hasDrug(loc2.stateId))) 
                            {
                                continue;
                            }
                            loc1 = true;
                            this._gameui.updateHintIcon(loc2.getLeavSeconds());
                            break;
                        }
                    }
                    if (!loc1) 
                    {
                        this._gameui.updateHintIcon(cache.buff.getBufferLeavSeconds(BuffRule.DrugTurned));
                    }
                }
            }
            else if (this._gameui) 
            {
                this._gameui.removeTurnedHintIcon();
            }
            return;
        }

        /* internal  */onMarrySkillTurnChangeHandler(arg1: PlayerEvent): void
        {
            if (RolePlayer.instance.isMarryTurned) 
            {
                if (this._gameui) 
                {
                    this._gameui.addTurnedHintIcon();
                    this._gameui.updateHintIcon(cache.buff.getBufferLeavSeconds(BuffRule.MarrySkillChangeModel));
                }
            }
            else if (this._gameui) 
            {
                this._gameui.removeTurnedHintIcon();
            }
            return;
        }

        /* internal  */onBuffRemainTimeUpdateHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as BuffInfo;
            if (loc1) 
            {
                if (DrugChangeConfig.instance.hasDrug(loc1.stateId)) 
                {
                    this._gameui.updateHintIcon(loc1.getLeavSeconds());
                }
            }
            return;
        }

        /* internal  */onGotoPayHandler(arg1: DataEvent): void
        {
            var loc1=ParamsConst.instance.payUrl;
            if (loc1 != "") 
            {
                BrowerUtil.getUrl(loc1);
            }
            return;
        }

        /* internal  */onMapFindPath(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            if (loc1) 
            {
                this._gameui.updateSmallMapPath(loc1);
            }
            return;
        }

        /* internal  */onSceneUpdateHandler(arg1: DataEvent): void
        {
            if (!Game.sceneInfo) 
            {
                return;
            }
            var loc1=Game.sceneInfo.sMapDefine.campType.__value;
            this._gameui.updateMiniMap();
            this._gameui.updateMapName(cache.scene.getCampMapName());
            var loc2=Language.getString(50062) + Game.sceneInfo.sMapDefine.name;
            MsgManager.showRollTipsMsg(loc2);
            if (GameMapUtil.isEnemyMapByInfo(Game.sceneInfo) && Cache.instance.role.entityInfo.level >= GameConst.SetFightModeLevel && Cache.instance.role.entityInfo.fightModel == EEntityFightMode._EEntityFightModePeace) 
            {
                if (!cache.guild.isInSelfManorMap()) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.FightSetMode, EEntityFightMode.convert(EEntityFightMode._EEntityFightModeFight)));
                }
            }
            if (cache.guild.guildPartyOpen) 
            {
                NetDispatcher.dispatchCmd(ServerCommand.GuildPartyOpenCommand, cache.guild.guildPartyOpen);
            }
            var loc3;
            if (loc3 = cache.guild.isInSelfManorMap()) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GuildManorEnterInto));
                cache.guild.preIsInGuildMap = loc3;
            }
            if (cache.guild.preIsInGuildMap && !loc3) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.GuildManorLeave));
            }
            if (!GameMapUtil.curMapState.isCrossBossField) 
            {
                this.onGroupPlayerInfoChange();
            }
            return;
        }

        /* internal  */onRoleExpHandler(arg1: SRole): void
        {
            var loc1=cache.role.roleInfo.experience;
            this._gameui.updateExp(loc1, cache.role.maxExp);
            return;
        }

        /* internal  */onPlayerRoleInfoUpdate(arg1: PlayerEvent): void
        {
            var loc1=arg1.player;
            this._gameui.updateAvatar(loc1.entityInfo.entityInfo);
            var loc2=Cache.instance.role.roleInfo.experience;
            var loc3=cache.role.maxExp;
            this._gameui.updateExp(loc2, loc3);
            if (cache.autoResumeSet.isSaveSysset) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.RoleAutoResume));
            }
            if (GameUIController.isLogined == false) 
            {
                if (loc1.entityInfo.entityInfo.level != -1) 
                {
                    GameUIController.isLogined = true;
                }
                if (loc1.entityInfo.entityInfo.level >= 36) 
                {
                    this._gameui.showWalkthroughIcon();
                }
            }
            if (loc1.entityInfo.entityInfo.level >= 36) 
            {
                this._gameui.showPetMenu();
            }
            return;
        }

        /* internal  */cdComplete(): void
        {
            this.onRoleAutoResumeHandler(null);
            return;
        }

        public onRoleAutoResumeHandler(arg1: DataEvent): void
        {
            var loc1=null;
            var loc6=0;
            if (cache.role.isBoss() || GameMapUtil.curMapState.isRobFlag || cache.copy.isHeroBattleCopy()) 
            {
                return;
            }
            var loc2=cache.autoResumeSet.isRoleLifeEnough();
            var loc3=cache.autoResumeSet.isRoleManaEnough();
            var loc4=true;
            var loc5=true;
            if (loc2) 
            {
                loc4 = true;
            }
            else if (cache.autoResumeSet.isUsingLifeDrugBag) 
            {
                if (!cache.timeCdCache.changeShengLifeCd.isCoolDown) 
                {
                    GameProxy.roleProxy.useDrugBag(EDrug._EDrugLifeBag);
                    cache.timeCdCache.changeShengLifeCd.reset();
                    cache.timeCdCache.changeShengLifeCd.startCoolDown();
                    cache.timeCdCache.lifeCD.reset();
                    cache.timeCdCache.lifeCD.resetTotalTime();
                    cache.timeCdCache.lifeCD.startCoolDown();
                }
            }
            else 
            {
                loc1 = cache.pack.backPackCache.getRoleHighestBloodDrugItem(cache.role.entityInfo);
                if (loc1) 
                {
                    GameUIController._isShowResumeTip = true;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.BackPack_Use, loc1));
                }
                else 
                {
                    loc4 = false;
                    this.showResumeTip(Language.getString(50063));
                    if (AutoFight.currentAutoFight.isAutoFight && AutoFight.currentAutoFight.backCity) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.AutoFightEnd));
                        MsgManager.showRollTipsMsg(Language.getString(50064));
                    }
                }
            }
            if (loc3) 
            {
                loc5 = true;
            }
            else if (cache.autoResumeSet.isUsingManaDrugBag) 
            {
                if (!cache.timeCdCache.manaCD.isCoolDown && cache.timeCdCache.manaCD.isRequestCd == false) 
                {
                    GameProxy.roleProxy.useDrugBag(EDrug._EDrugManaBag);
                    cache.timeCdCache.manaCD.resetTotalTime();
                    cache.timeCdCache.manaCD.startItemCd();
                }
            }
            else 
            {
                loc1 = Cache.instance.pack.backPackCache.getRoleHighestManaDrugItem(cache.role.entityInfo);
                if (loc1) 
                {
                    GameUIController._isShowResumeTip = true;
                    Dispatcher.dispatchEvent(new DataEvent(EventName.BackPack_Use, loc1));
                }
                else 
                {
                    loc5 = false;
                    this.showResumeTip(Language.getString(50065));
                }
            }
            if (!loc4 && loc5) 
            {
                loc6 = RoleDrugEnoughType.lifeNotEnough;
            }
            else if (loc4 && !loc5) 
            {
                loc6 = RoleDrugEnoughType.manaNotEnough;
            }
            else if (!loc4 && !loc5) 
            {
                loc6 = RoleDrugEnoughType.allNotEnough;
            }
            else 
            {
                loc6 = RoleDrugEnoughType.allEnough;
                UiHintIconView.instance.removeHintIcon(this._drugHintIcon);
            }
            if (!(loc6 == 0) && !(loc6 == RoleDrugEnoughType.allEnough)) 
            {
                if (!this._drugHintIcon || !this._drugHintIcon.parent) 
                {
                    if (!PulseSharedObject.isTodayNotTips(Cache.instance.guide.guideDrugSaveKey)) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.RoleDrugNotEnough, loc6));
                    }
                }
            }
            else if (loc6 == RoleDrugEnoughType.allEnough) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.RoleDrugNotEnough, RoleDrugEnoughType.allEnough));
            }
            return;
        }

        /* internal  */onGuideDrugBuyCloseHandler(arg1: DataEvent): void
        {
            var loc1=cache.autoResumeSet.isRoleLifeEnough();
            var loc2=cache.autoResumeSet.isRoleManaEnough();
            if (!loc1 || !loc2) 
            {
                if (!PulseSharedObject.isTodayNotTips(Cache.instance.guide.guideDrugSaveKey)) 
                {
                    if (this._drugHintIcon == null) 
                    {
                        this._drugHintIcon = new DrugHintIcon();
                    }
                    UiHintIconView.instance.addHintIcon(this._drugHintIcon);
                }
            }
            return;
        }

        /* internal  */showResumeTip(arg1: string): void
        {
            if (GameUIController._isShowResumeTip) 
            {
                MsgManager.showRollTipsMsg(arg1);
                GameUIController._isShowResumeTip = false;
            }
            return;
        }

        /* internal  */onBufferUpdate(arg1: Array<any>): void
        {
            if (this._gameui) 
            {
                this._gameui.updateBuffer(cache.buff.showBuffArray);
            }
            return;
        }

        /* internal  */onDailyAwardAdd(arg1: Object): void
        {
            this._gameui.updateDailyAward(arg1);
            return;
        }

        public onLevelAwardAdd(arg1: Object): void
        {
            this._gameui.removeLevelAward();
            this._gameui.updateLevelAward(arg1);
            return;
        }

        /* internal  */onSkillShortCatUpdate(arg1: Map<any, any> /* flash.utils.Dictionary */): void
        {
            this._gameui.updateShortcuts(arg1);
            return;
        }

        /* internal  */onPlayerSelected(arg1: DataEvent): void
        {
            var loc1=arg1.data as IEntity;
            if (loc1.selected) 
            {
                if (loc1.type != EntityType.NPC) 
                {
                    if (loc1.type != EntityType.Boss) 
                    {
                        this._gameui.updateAimAvatar(loc1.entityInfo);
                    }
                    else 
                    {
                        this._gameui.updateMonsterAvatar(loc1.entityInfo.entityInfo);
                    }
                }
                else 
                {
                    this._gameui.updateNpcAvatar(loc1.entityInfo.entityInfo);
                }
                loc1.addEventListener(PlayerEvent.UPDATEINFO, this.onPlayerInfoUpdate);
            }
            else 
            {
                if (loc1.type == EntityType.NPC) 
                {
                    this._gameui.removeAvatar(4);
                    return;
                }
                if (loc1.type != EntityType.Boss) 
                {
                    this._gameui.removeAvatar(3);
                }
                else 
                {
                    this._gameui.removeAvatar(5);
                }
                loc1.removeEventListener(PlayerEvent.UPDATEINFO, this.onPlayerInfoUpdate);
            }
            return;
        }

        /* internal  */onPlayerInfoUpdate(arg1: PlayerEvent): void
        {
            var loc1=arg1.player;
            if (loc1.entityInfo.entityInfo.entityId.type != EntityType.Boss) 
            {
                this._gameui.updateAimAvatar(loc1.entityInfo);
            }
            else 
            {
                this._gameui.updateMonsterAvatar(loc1.entityInfo.entityInfo);
            }
            return;
        }

        /* internal  */onMapUpdateRolePosition(arg1: DataEvent): void
        {
            this._gameui.setPoint(arg1.data as AStarPoint);
            return;
        }

        /* internal  */onRoleMoveEnd(arg1: PlayerEvent): void
        {
            this._gameui.setPoint(RolePlayer.instance.currentPoint);
            return;
        }

        /* internal  */onConveyRes(arg1: DataEvent): void
        {
            this._gameui.conveyRes();
            return;
        }

        /* internal  */onGameUIClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target as Object /* flash.display.SimpleButton */;
            if (loc1) 
            {
                this._gameui.guideHideTips(loc1.name);
                GameManager.instance.popupWindow(loc1.name);
            }
            return;
        }

        /* internal  */onNewMailComeHandler(arg1: DataEvent): void
        {
            this._gameui.setMailNotice(true);
            SoundManager.instance.soundPlay(SoundTypeConst.LettersReack);
            return;
        }

        /* internal  */onNewMailHadQuery(arg1: DataEvent): void
        {
            this._gameui.setMailNotice(false);
            return;
        }

        /* internal  */onTWhuiNotHaveVisitAll(arg1: DataEvent): void
        {
            this._gameui.setTWNotVisitAll();
            return;
        }

        /* internal  */onScenePetUpdateHandler(arg1: DataEvent): void
        {
            var loc1=null;
            if (cache.pet.battlePet) 
            {
                loc1 = arg1.data as SEntityInfo;
                this._petEntity = ThingUtil.entityUtil.getEntity(loc1.entityId);
                this._gameui.addAvatar(2, this._petEntity.entityInfo.entityInfo);
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetAutoResume));
                this._gameui.removePetAvatarHighlight();
            }
            return;
        }

        public onPetBagUpdateHandler(arg1: DataEvent): void
        {
            this._gameui.dealPetBagUpdate();
            return;
        }

        /* internal  */onPetInfoUpdate(arg1: PlayerEvent): void
        {
            var loc2=null;
            var loc1=arg1.player;
            if (loc1) 
            {
                loc2 = loc1.entityInfo.entityInfo;
                this._gameui.addAvatar(2, loc2);
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetAutoResume, loc2));
            }
            return;
        }

        /* internal  */onPetRemoveHandler(arg1: Object /* flash.events.Event */): void
        {
            if (this._petEntity) 
            {
                this._petEntity.removeEventListener(PlayerEvent.UPDATEINFO, this.onPetInfoUpdate);
                this._petEntity.removeEventListener(flash.events.Event.REMOVED_FROM_STAGE, this.onPetRemoveHandler);
                this._petEntity = null;
            }
            return;
        }

        public onPetAutoResumeHandler(arg1: DataEvent): void
        {
            var loc9=null;
            var loc1=this._gameui.getPetAvatarSPetInfo();
            if (loc1 == null) 
            {
                return;
            }
            var loc2=arg1.data as SEntityInfo;
            if (loc2 == null) 
            {
                loc2 = new SEntityInfo();
                loc2.life = loc1.life;
                loc2.maxLife = loc1.fightAttribute.maxLife;
                loc2.mana = loc1.mana;
                loc2.maxMana = loc1.fightAttribute.maxMana;
                loc2.level = loc1.level;
            }
            var loc3=loc2.life;
            var loc4=loc2.maxLife;
            var loc5=loc2.mana;
            var loc6=loc2.maxMana;
            var loc7=cache.autoResumeSet.petLifeSet;
            var loc8=cache.autoResumeSet.petManaSet;
            if (loc3 == 0) 
            {
                return;
            }
            if (loc3 < loc4 * loc7) 
            {
                if (cache.autoResumeSet.isPetUsingLifeDrugBag) 
                {
                    if (!cache.timeCdCache.petLifeCD.isCoolDown && cache.timeCdCache.petLifeCD.isRequestCd == false) 
                    {
                        if (loc1) 
                        {
                            GameProxy.roleProxy.useDrugBag(EDrug._EDrugLifePetBag, loc1.uid);
                            cache.timeCdCache.petLifeCD.totalTime = 10000;
                            cache.timeCdCache.petLifeCD.startItemCd();
                        }
                    }
                }
                else 
                {
                    Dispatcher.dispatchEvent(new DataEvent(GModuleEvent.PetAutoFeedPet, {"petInfo": loc1, "feedType": Life, "effectType": Duration}));
                }
            }
            if (AutoFight.currentAutoFight.petEatDrug) 
            {
                if (int(loc1.energy / 3) < 10) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(GModuleEvent.PetAutoFeedPet, {"petInfo": loc1, "feedType": Energy, "effectType": Moment}));
                }
            }
            return;
        }

        /* internal  */onPetRestSuccessHandler(arg1: DataEvent): void
        {
            this._gameui.showCBtn(true);
            this._gameui.petRest();
            return;
        }

        /* internal  */onPetDeathHandler(arg1: DataEvent): void
        {
            this._gameui.petDeath();
            return;
        }

        /* internal  */onEnterCopyMap(arg1: DataEvent): void
        {
            if (!this.isSpecialCopy()) 
            {
                this._showCopyTeamate = true;
                this.onGroupPlayerInfoChange();
                NetDispatcher.removeCmdListener(ServerCommand.Group_PlayerInfoChange, this.onGroupPlayerInfoChange);
                NetDispatcher.removeCmdListener(ServerCommand.CrossGroup_PlayerInfoChange, this.onGroupPlayerInfoChange);
                NetDispatcher.addCmdListener(ServerCommand.Copy_PlayerInfoChange, this.onGroupPlayerInfoChange);
                NetDispatcher.addCmdListener(ServerCommand.GuildGroup_PlayerChange, this.onGroupPlayerInfoChange);
            }
            return;
        }

        /* internal  */onLeaveCopyMap(arg1: DataEvent): void
        {
            if (!this.isSpecialCopy()) 
            {
                this._showCopyTeamate = false;
                this.onGroupPlayerInfoChange();
                NetDispatcher.addCmdListener(ServerCommand.Group_PlayerInfoChange, this.onGroupPlayerInfoChange);
                NetDispatcher.addCmdListener(ServerCommand.CrossGroup_PlayerInfoChange, this.onGroupPlayerInfoChange);
                NetDispatcher.removeCmdListener(ServerCommand.Copy_PlayerInfoChange, this.onGroupPlayerInfoChange);
                NetDispatcher.removeCmdListener(ServerCommand.GuildGroup_PlayerChange, this.onGroupPlayerInfoChange);
            }
            return;
        }

        /* internal  */isSpecialCopy(): Boolean
        {
            return cache.copy.isInCopyType(ECopyType._ECopyBattle) || cache.copy.isInCopyType(ECopyType._ECopyBossField) || cache.copy.isInCopyType(ECopyType._ECopyCrossBossField) || cache.copy.isInCopyType(ECopyType._ECopyCrossSpiritWar);
        }

        /* internal  */onGroupPlayerInfoChange(arg1: Array<any>=null): void
        {
            var loc3=null;
            if (arg1 == null) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.Group_Disband));
            }
            var loc1=[];
            if (this._showCopyTeamate) 
            {
                if (Game.sceneInfo.sMapDefine.instanceType && (Game.sceneInfo.sMapDefine.instanceType.value() == EMapInstanceType._EMapInstanceTypeGuildWar || Game.sceneInfo.sMapDefine.instanceType.value() == EMapInstanceType._EMapInstanceTypeArenaBattle || Game.sceneInfo.sMapDefine.instanceType.value() == EMapInstanceType._EMapInstanceTypeGangFightsBattle) || Game.sceneInfo.sMapDefine.instanceType.value() == EMapInstanceType._EMapInstanceTypeEatBeans) 
                {
                    arg1 = [];
                }
                else if (GameMapUtil.curMapState.isGuildElite) 
                {
                    arg1 = cache.guildElite.players;
                }
                else if (GameMapUtil.curMapState.isFightWar || GameMapUtil.curMapState.isBossField) 
                {
                    arg1 = cache.group.players;
                }
                else 
                {
                    arg1 = cache.copy.players;
                }
            }
            else if (GameMapUtil.isCrossGroupMap()) 
            {
                arg1 = cache.crossGroup.players;
            }
            else if (Game.sceneInfo.sMapDefine.instanceType && (Game.sceneInfo.sMapDefine.instanceType.value() == EMapInstanceType._EMapInstanceTypeEatBeans || Game.sceneInfo.sMapDefine.instanceType.value() == EMapInstanceType._EMapInstanceTypeCrossSpiritWar)) 
            {
                arg1 = [];
            }
            else 
            {
                arg1 = cache.group.players;
            }
            var loc2=0;
            while (loc2 < arg1.length) 
            {
                loc3 = (arg1[loc2] as SPublicMiniPlayer).entityId;
                if (EntityUtil.toString(loc3) != EntityUtil.toString(cache.role.entityInfo.entityId)) 
                {
                    loc1.push(arg1[loc2]);
                }
                ++loc2;
            }
            this._gameui.teamAvatarSprite.updateTeamAvatar(loc1);
            return;
        }

        /* internal  */onFightSetModeHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as EEntityFightMode;
            GameProxy.sceneProxy.setMode(loc1);
            return;
        }

        /* internal  */onFightSetModeSuccessHandler(arg1: DataEvent): void
        {
            this._gameui.setFightModeButton();
            var loc1=arg1.data as EEntityFightMode;
            if (!this._lastMode || !(this._lastMode.__value == loc1.__value)) 
            {
                this._lastMode = loc1;
                if (loc1.value() != EEntityFightMode._EEntityFightModeFight) 
                {
                    if (loc1.value() == EEntityFightMode._EEntityFightModePeace) 
                    {
                        MsgManager.showRollTipsMsg(Language.getString(50067));
                    }
                }
                else 
                {
                    MsgManager.showRollTipsMsg(Language.getString(50066));
                }
            }
            return;
        }

        /* internal  */onAutoFightKey(arg1: DataEvent): void
        {
            cache.guide.autoFightGuide = false;
            this._gameui.guideHideTips(ModuleType.AutoFight);
            return;
        }

        /* internal  */onSkillWindowShowHandler(arg1: DataEvent): void
        {
            this._gameui.guideHideTips(ModuleType.Skills);
            Dispatcher.removeEventListener(EventName.SkillWindowShow, this.onSkillWindowShowHandler);
            return;
        }

        /* internal  */onEquipmentWindowOpen(arg1: DataEvent): void
        {
            this._gameui.guideHideTips(ModuleType.Build);
            Dispatcher.removeEventListener(EventName.Equipment_WindowOpen, this.onEquipmentWindowOpen);
            return;
        }

        /* internal  */onGuildWindowOpenHandler(arg1: DataEvent): void
        {
            if (cache.guide.guideApplyGuild) 
            {
                this._gameui.guideHideTips(ModuleType.Guild);
            }
            return;
        }

        public getGameui(): GameUI
        {
            return this.view as GameUI;
        }

        /* internal  */onUseDrugBagSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            if (loc1 != EDrug._EDrugLifeBag) 
            {
                if (loc1 == EDrug._EDrugManaBag) 
                {
                    cache.timeCdCache.manaCD.startCoolDown();
                    Dispatcher.dispatchEvent(new DataEvent(EventName.ItemUse, cache.timeCdCache.manaCD));
                }
            }
            else 
            {
                cache.timeCdCache.changeShengLifeCd.startCoolDown();
                Dispatcher.dispatchEvent(new DataEvent(EventName.ItemUse, cache.timeCdCache.lifeCD));
            }
            return;
        }

        /* internal  */onRoleLevelUpdate(arg1: Object): void
        {
            if (this._gameui != null) 
            {
                this.onFavoriteUpdateHandler(null);
                this._gameui.highlightWalkthroughIcon();
            }
            if (cache.role.entityInfo.level > 36 && this._gameui) 
            {
                this._gameui.showShrinkBtn();
            }
            if (cache.role.entityInfo.level >= 65) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetCpnShowIcon));
            }
            if (Cache.instance.petMing.isOpenJu) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetMingOpen));
                if (this._gameui != null) 
                {
                    this._gameui.showJuMenu();
                }
            }
            return;
        }

        /* internal  */onHighlightGameUIHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data["type"] as string;
            var loc2=arg1.data["name"] as string;
            var loc3=arg1.data["isGlow"] as Boolean;
            if (loc1 == "Navbar") 
            {
                this._gameui.HighlightNavbar(loc2, loc3);
            }
            return;
        }

        /* internal  */onFavoriteUpdateHandler(arg1: DataEvent): void
        {
            this._gameui.showOrHideFavorite();
            return;
        }

        /* internal  */onAddFavoriteHandler(arg1: DataEvent): void
        {
            GameProxy.roleProxy.favoriteGame();
            return;
        }

        /* internal  */onShowVipCard(arg1: DataEvent): void
        {
            var loc1=arg1.data.start as Object /* flash.geom.Point */;
            var loc2=arg1.data.bmp as Object /* flash.display.BitmapData */;
            var loc3=arg1.data.item as ItemData;
            this._gameui.showVipCard(loc1, loc2, loc3);
            return;
        }

        /* internal  */onHideVipCard(arg1: DataEvent): void
        {
            this._gameui.hideVipCard();
            return;
        }

        /* internal  */onTestVIPCardRes(arg1: DataEvent): void
        {
            if (this._gameui != null) 
            {
                this._gameui.onVipTestCardRes();
            }
            return;
        }

        /* internal  */onQuestionShowMainBtnHandler(arg1: DataEvent): void
        {
            if (this._gameui != null) 
            {
                this._gameui.addQuestionButton();
            }
            return;
        }

        /* internal  */onQuestionRemoveMainBtnHandler(arg1: DataEvent): void
        {
            if (this._gameui != null) 
            {
                this._gameui.removeQuestionButton();
            }
            return;
        }

        /* internal  */onFlyLevelAwardHandler(arg1: DataEvent): void
        {
            if (this._gameui != null) 
            {
                this._gameui.flyLevelAward();
            }
            return;
        }

        /* internal  */onVIPLevelUpgradeHandler(arg1: SVIPInfo): void
        {
            cache.guide.vipLevelUpGuide = true;
            if (GameController.vip.isViewShow) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_VipGiftGet, arg1));
            }
            else if (this._gameui != null) 
            {
                this._gameui.onVIPLevelUpgrade(arg1);
            }
            return;
        }

        /* internal  */onShowWalkthroughHandler(arg1: DataEvent): void
        {
            this._gameui.showWalkthroughIcon();
            return;
        }

        /* internal  */onRoleEnergyCompleteHandler(arg1: DataEvent): void
        {
            if (cache.role.entityInfo.level <= 50) 
            {
                if (this._gameui) 
                {
                    this._gameui.energyComplete();
                }
            }
            return;
        }

        /* internal  */onDailyDegreeUpdate(arg1: DataEvent): void
        {
            if (cache.daily.hasCanGetProcess()) 
            {
                if (!GameController.daily.isViewShow) 
                {
                    if (this._gameui) 
                    {
                        this._gameui.guideOpenModule(ModuleType.Activity, cache.mainUINavbar.isUIByLevel);
                    }
                }
            }
            return;
        }

        /* internal  */onSkillLevelGetShowHandler(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.showLevelGetSkill();
            }
            return;
        }

        /* internal  */onDrugBagWindowOpenHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            if (this._drugBagWindow == null) 
            {
                this._drugBagWindow = new DrugBagWindow();
            }
            this._drugBagWindow.showTabByIndex(loc1);
            this._drugBagWindow.show();
            return;
        }

        /* internal  */onDrugBagInfoUpdateHandler(arg1: SDrugBagInfo): void
        {
            if (this._drugBagWindow && this._drugBagWindow.isHide == false) 
            {
                this._drugBagWindow.updateByDrugInfo(arg1);
            }
            return;
        }

        /* internal  */onWalkthroughWindowOpenHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as int;
            WalkthroughListWindow.instance.updateByType(loc1);
            WalkthroughListWindow.instance.show();
            return;
        }

        /* internal  */onRoleFlyStartHandler(arg1: DataEvent): void
        {
            GameProxy.sceneProxy.startFly();
            return;
        }

        /* internal  */onRoleFlyEndHandler(arg1: DataEvent): void
        {
            GameProxy.sceneProxy.endFly();
            return;
        }

        /* internal  */onGuideModuleOpen(arg1: DataEvent): void
        {
            if (!_view) 
            {
                return;
            }
            var loc1=String(arg1.data);
            if (loc1 != ModuleType.Pets) 
            {
                if (loc1 != ModuleType.AutoFight) 
                {
                    if (loc1 != ModuleType.Skills) 
                    {
                        if (loc1 != ModuleType.Build) 
                        {
                            this.getGameui().guideOpenModule(loc1, cache.mainUINavbar.isUIByLevel);
                        }
                        else if (GameController.equipment.isViewShow) 
                        {
                            Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_EquipBuild));
                        }
                        else 
                        {
                            this.getGameui().guideOpenModule(ModuleType.Build, cache.mainUINavbar.isUIByLevel);
                        }
                    }
                    else if (GameController.skill.isViewShow) 
                    {
                        Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_SkillLearn));
                    }
                    else 
                    {
                        this.getGameui().guideOpenModule(ModuleType.Skills, cache.mainUINavbar.isUIByLevel);
                    }
                }
                else if (GameController.autoFightBrief.autoFightBrief.isHide) 
                {
                    this.getGameui().guideOpenModule(ModuleType.AutoFight, cache.mainUINavbar.isUIByLevel);
                }
                else 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_Hang));
                }
            }
            else if (cache.guide.petGuide) 
            {
                if (GameController.pet.isViewShow) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_PetCall));
                }
                else 
                {
                    this.getGameui().guideOpenModule(loc1, cache.mainUINavbar.isUIByLevel);
                }
            }
            else if (cache.guide.guidePetRefresh) 
            {
                if (GameController.pet.isViewShow) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_PetRefresh));
                }
                else 
                {
                    this.getGameui().guideOpenModule(loc1, cache.mainUINavbar.isUIByLevel);
                }
            }
            else if (cache.guide.guidePetMerge) 
            {
                if (GameController.pet.isViewShow) 
                {
                    Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_PetMerge));
                }
                else 
                {
                    this.getGameui().guideOpenModule(loc1, cache.mainUINavbar.isUIByLevel);
                }
            }
            else if (cache.guide.petVersionChange) 
            {
                if (!GameController.pet.isViewShow) 
                {
                    this.getGameui().guideOpenModule(loc1, cache.mainUINavbar.isUIByLevel);
                }
            }
            else if (cache.guidePetLifeStyle.isGuideDressLifeStyle) 
            {
                this.getGameui().guideOpenModule(loc1, cache.mainUINavbar.isUIByLevel);
            }
            return;
        }

        /* internal  */onGuideModuleHide(arg1: DataEvent): void
        {
            if (!_view) 
            {
                return;
            }
            var loc1=String(arg1.data);
            this.getGameui().guideHideTips(loc1);
            return;
        }

        /* internal  */onGuideDaily(arg1: DataEvent): void
        {
            if (!GameController.daily.isViewShow) 
            {
                this._gameui.guideOpenModule(ModuleType.Activity, cache.mainUINavbar.isUIByLevel);
            }
            return;
        }

        /* internal  */onGuidePetFight(arg1: DataEvent): void
        {
            if (!GameController.petCompetition.isViewShow) 
            {
                this._gameui.guidePetFight();
            }
            return;
        }

        /* internal  */onGuidePetLifeStyleOpen(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.guidePetLifeStyle();
            }
            return;
        }

        /* internal  */onGuidePetEquipRefresh(arg1: DataEvent): void
        {
            if (GameController.petEquip.isViewShow) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_PetEquipRefresh2));
            }
            else 
            {
                this._gameui.onGuidePetEquipRefresh();
            }
            return;
        }

        /* internal  */onGuidePetEquipStrenthenHandler(arg1: DataEvent): void
        {
            if (GameController.petEquip.isViewShow) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_PetEquipStrenthenStep2));
            }
            else 
            {
                this._gameui.onGuidePetEquipStrenthen();
            }
            return;
        }

        /* internal  */onGuideFirstPurplePetEquipmentHandler(arg1: DataEvent): void
        {
            if (GameController.jewel.isViewShow) 
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.Guide_FirstPurplePetEquipmentStep2));
            }
            else 
            {
                this._gameui.onGuideFirstPurplePetEquipment();
            }
            return;
        }

        /* internal  */onGameUINavBarSetButtonVisibleHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data.name as string;
            var loc2=arg1.data.value;
            this._gameui.onGameUINavBarSetButtonVisible(loc1, loc2);
            return;
        }

        /* internal  */onGuidePetSkillRefreshHandler(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.openPetModuleSkillRefresh();
            }
            return;
        }

        /* internal  */onGuideFragmentOpenPackHandler(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.openPackModuleUseFragment(arg1.data as ItemData);
            }
            return;
        }

        /* internal  */onGuideFragmentOpenRoleHandler(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.openRoleModuleUseFragment();
            }
            return;
        }

        /* internal  */onGuideSkillMarry(arg1: DataEvent): void
        {
            if (this._gameui) 
            {
                this._gameui.onGuideSkillMarry();
            }
            return;
        }

        private /* var */_gameui: GameUI;

        private /* var */_drugHintIcon: DrugHintIcon;

        private /* var */_scIsShow: Boolean=false;

        private /* var */_showCopyTeamate: Boolean=false;

        private /* var */_petEntity: IEntity;

        private /* var */_drugBagWindow: DrugBagWindow;

        private static /* var */_isShowResumeTip: Boolean=true;

        private static /* var */isLogined: Boolean;

        private /* var */_lastMode: EEntityFightMode;
    }
